import { Controller, Post, Body, Get, Query,Param } from '@nestjs/common';
import { AiService } from './ai.service';

@Controller('ai')
export class AiController {
  constructor(private readonly aiService: AiService) {}

  //上传aicontent
  @Post('/content')
  createContent(@Body() body: any) {
    return this.aiService.createContent(body);
  }

  //获取aicontent
  @Get('/content')
  getContent(@Query() query: any) {
    // console.log(query, 'query');
    return this.aiService.getContent(query);
  }

  //修改aicontent
  @Post('/content/:id')
  updateContent(@Param('id') id: string, @Body() body: any) {
    return this.aiService.updateContent(id, body);
  }
}
